﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;
using nERP.Model.Fin;
using nERP.Model.Po;

namespace nERP.Model.Fin
{
    /// <summary>
    /// 付款单明细
    /// </summary>
	[Table("PaymentDetail")]
    [SoftKey(nameof(PaymentDetail.PayDetailCode))]
    [Display(Name = "_Model.PaymentDetail")]
    public class PaymentDetail : BasePoco,ITenant
    {
        [Display(Name = "_Model._PaymentDetail._Seq")]
        [Comment("序号")]
        public int? Seq { get; set; }
        [Display(Name = "_Model._PaymentDetail._PayDetailCode")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("付款明细单号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string PayDetailCode { get; set; }
        [Display(Name = "_Model._PaymentDetail._Pay")]
        [Comment("付款单")]
        [NotMapped]
        public Payment Pay { get; set; }
        [Display(Name = "_Model._PaymentDetail._Pay")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("付款单")]
        public string PayId { get; set; }
        [Display(Name = "_Model._PaymentDetail._Buy")]
        [Comment("采购订单")]
        [NotMapped]
        public Buy Buy { get; set; }
        [Display(Name = "_Model._PaymentDetail._Buy")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("采购订单")]
        public string BuyId { get; set; }
        [Display(Name = "_Model._PaymentDetail._Amount1")]
        [Comment("单据金额")]
        public decimal? Amount1 { get; set; }
        [Display(Name = "_Model._PaymentDetail._Amount2")]
        [Comment("已结金额")]
        public decimal? Amount2 { get; set; }
        [Display(Name = "_Model._PaymentDetail._Amount3")]
        [Comment("未结金额")]
        public decimal? Amount3 { get; set; }
        [Display(Name = "_Model._PaymentDetail._Amount4")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("本次结算金额")]
        public decimal? Amount4 { get; set; }
        [Display(Name = "_Model._PaymentDetail._Status")]
        [Comment("状态")]
        public dStatusTypeEnum? Status { get; set; } = dStatusTypeEnum.Unaudited;
        [Display(Name = "_Model._PaymentDetail._Remark")]
        [StringLength(256, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("备注")]
        public string Remark { get; set; }
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
